cmake_minimum_required(VERSION 3.5)
PROJECT(SamplesAndTutos)

OPTION(INSTALL_SAMPLES "Once build, deploy samples into bin" ON)
OPTION(BUILD_CPP "Build c++ samples else c#" ON)

if(${BUILD_CPP})
    SET(TYPE "cpp")
else()
    SET(TYPE "csharp")
endif()

SET(CMAKE_BUILD_TYPE "Release")

SET(SAMPLE_LIST "")
add_subdirectory("body tracking/body tracking/${TYPE}")
add_subdirectory("body tracking/export/fbx export/${TYPE}")
add_subdirectory("body tracking/multi-camera/${TYPE}")
add_subdirectory("camera control/${TYPE}")
add_subdirectory("camera streaming/receiver/${TYPE}")
add_subdirectory("camera streaming/sender/${TYPE}")	
add_subdirectory("depth sensing/depth sensing/${TYPE}")
add_subdirectory("depth sensing/multi camera/${TYPE}")
add_subdirectory("depth sensing/image refocus/${TYPE}")
add_subdirectory("depth sensing/region of interest/${TYPE}")
add_subdirectory("geotracking/live geotracking/${TYPE}")
add_subdirectory("geotracking/playback/${TYPE}")
add_subdirectory("geotracking/recording/${TYPE}")
add_subdirectory("object detection/image viewer/${TYPE}")
add_subdirectory("object detection/birds eye viewer/${TYPE}")
add_subdirectory("object detection/concurrent detections/cpp")
add_subdirectory("plane detection/plane detection/${TYPE}")
add_subdirectory("plane detection/floor plane/${TYPE}")
add_subdirectory("positional tracking/positional tracking/${TYPE}")
add_subdirectory("spatial mapping/spatial mapping/${TYPE}")
add_subdirectory("recording/export/sensors/${TYPE}")
add_subdirectory("recording/export/svo/${TYPE}")
add_subdirectory("recording/playback/${TYPE}")
add_subdirectory("recording/recording/multi camera/${TYPE}")
add_subdirectory("recording/recording/mono/${TYPE}")

add_subdirectory("tutorials")

if(${INSTALL_SAMPLES} AND ${BUILD_CPP})
    INSTALL(TARGETS ${SAMPLE_LIST} RUNTIME DESTINATION ${CMAKE_SOURCE_DIR}/bin)
endif()
